<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head th:replace="common/common_header :: common_header('部门管理')"></head>
<body class="father_body">
<!--    树-->
    <div>
        <ul id="deptTree" class="dtree" data-id="0"></ul>
    </div>

</body>
<div th:replace="common/common_foot::common_foot(~{::script})"></div>
<script type="text/javascript">
    var  leftDeptTree;
    layui.extend({
        dtree: '/layui_ext/dtree/dtree'   // {/}的意思即代表采用自有路径，即不跟随 base 路径
    }).use(['dtree','layer','jquery'], function(){

        var dtree = layui.dtree;
        var layer = layui.layer;
        var $=layui.jquery;

        leftDeptTree=dtree.render({
            elem: "#deptTree",
            url: "/dept/loadAllDeptTreeJson",
            dataStyle: "layuiStyle",  //使用layui风格的数据格式
            dataFormat: "list",  //配置data的风格为list
            response:{message:"msg",statusCode:0},  //修改response中返回数据的定义
        });
        dtree.on("node('deptTree')", function(obj){
            // layer.msg(JSON.stringify(obj.param.nodeId));
            window.parent.main.reloadTable(obj.param.nodeId);
        });
    });

</script>

</html>